#pragma once
#include "UIBase.h"
#include "../tools/RichTextEx.h"

enum CurrentChat
{
	QUANBU,
	FUJIN,
	DUIWU,
	HANGHUI,
	SILIAO,
};

class ChatUI : public UIBase
{
public:
	ChatUI();
	~ChatUI();
public:
	static cocos2d::Node* createNode();
	virtual bool init();
	CREATE_FUNC(ChatUI);

	Node* m_selectedNode;
	vector<Sprite*> m_controlList;

	Node* m_commandBg;

	ui::ListView* m_GGshowTextList;
	ui::ListView* m_FJshowTextList;
	ui::ListView* m_DWshowTextList;
	ui::ListView* m_HHshowTextList;
	ui::ListView* m_SLshowTextList;

	Sprite* m_GongGong_Btn;
	Sprite* m_FuJin_Btn;
	Sprite* m_DuiWu_Btn;
	Sprite* m_HangHui_Btn;
	Sprite* m_SiLiao_Btn;
	Sprite* m_Send_Btn;
	Sprite* m_MingLing_Btn;
	Sprite* m_closeBtn;
	ui::TextField* m_inputText;
	ui::Text* m_ExitText;
	ui::Text* m_JoinText;
	ui::Text* m_PassText;

	CurrentChat m_curChat;
	bool m_isListViewMove;
public:
	bool TouchDown(Touch* touch);
	void TouchMove(Touch* touch);
	bool TouchUp(Touch* touch);

	void Open();							//打开
	void Close();							//关闭
	void RefreshData();					//刷新背包界面数据
	void AddText(CurrentChat curChat,string str, int fcolor, int bcolor);
	void AddPrivateName(string name);
	void SendText();
};